import request from "@/utils/request";

// 新增活动
export function addActivity(data) {
  return request({
    url: `/marketing/activity`,
    method: "post",
    data,
  });
}

// 修改活动
export function updateActivity(data) {
  return request({
    url: `/marketing/activity`,
    method: "put",
    data,
  });
}

// 删除活动
export function deleteActivity(id) {
  return request({
    url: `/marketing/activity/${id}`,
    method: "delete",
  });
}
//查询活动列表
export function activityList(params) {
  return request({
    url: `/marketing/activity/page`,
    method: "get",
    params,
  });
}

//获取活动详情

export function activityInfo(id) {
  return request({
    url: `/marketing/activity/${id}`,
    method: "get",
  });
}

//关闭活动
export function closeActivity(id) {
  return request({
    url: `/marketing/activity/close/${id}`,
    method: "put",
  });
}

//更新活动黑名单
export function updateActivityBlackList(data) {
  return request({
    url: `/marketing/activity/blacklist`,
    method: "put",
    data,
  });
}